package com.delivery.mapper;

import com.delivery.anno.AutoFill;
import com.delivery.entity.Employee;
import com.delivery.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    @Select("select * from employee where username = #{username}")
    public Employee selectEmployeeByUsername(String username);


    @AutoFill(OperationType.INSERT)
    public void insertEmployee(Employee employee);

    List<Employee> employeePageSelect(String name);

    /**
     * 修改员工表信息
     * @param employee
     * @return
     */
    @AutoFill(OperationType.UPDATE)
    void updateEmployee(Employee employee);

    Employee selectById(Long id);
}
